From: Jim Blandy Date: Tue, 18 May 1993 22:45:53 +0000 (+0000) Subject: * xdisp.c (redisplay_window): Make the scrollbar reflect the X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1^2~5^2~96186 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=3505ea701237ad94d57200cd4ba6bc768a8eef3d;p=emacs.git * xdisp.c (redisplay_window): Make the scrollbar reflect the extent of the visible region, not the whole buffer. --- diff --git a/src/xdisp.c b/src/xdisp.c index ba33e111387..562e10aafbd 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -1060,6 +1060,11 @@ done: int start, end, whole; /* Calculate the start and end positions for the current window. + At some point, it would be nice to choose between scrollbars + which reflect the whole buffer size, with special markers + indicating narrowing, and scrollbars which reflect only the + visible region. + Note that minibuffers sometimes aren't displaying any text. */ if (! MINI_WINDOW_P (w) || (w == XWINDOW (minibuf_window) && ! echo_area_glyphs)) @@ -1068,7 +1073,10 @@ done: /* I don't think this is guaranteed to be right. For the moment, we'll pretend it is. */ end = Z - XINT (w->window_end_pos); - whole = Z - BEG; + whole = ZV - BEGV; + + if (end < start) end = start; + if (whole > (end - start)) whole = end - start; } else start = end = whole = 0;